/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.kmcsoft.goldshop.importgold.service.impl;

import com.kmcsoft.goldshop.importgold.service.ImportGoldService;
import com.kmcsoft.goldshop.model.master.GoldSource;
import com.kmcsoft.goldshop.model.scm.ImportGoldOrder;
import com.kmcsoft.master.defaultservice.DefaultGenericService;
import java.util.Collection;

/**
 *
 * @author kmcsoft02
 */
public class JdoImportGoldService extends DefaultGenericService implements ImportGoldService {

    public Collection<GoldSource> getGoldSources() {
        return getJdoTemplate().detachCopyAll(getJdoTemplate().find(GoldSource.class));
    }

    public ImportGoldOrder getImportGoldOrderById(Object id) {
        getPersistenceManager().getFetchPlan().addGroup("detach_ImportGoldOrder_All");
        getPersistenceManager().getFetchPlan().addGroup("detach_ImportGoldDetail_All");
        getPersistenceManager().getFetchPlan().setMaxFetchDepth(-1);
        return getJdoTemplate().detachCopy(getJdoTemplate().getObjectById(ImportGoldOrder.class, id));
    }
}
